<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('紫卡属性值分析')"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<body>
<div class="container-div">
    <div class="row">
        <div class="container-div">
            <div class="row">
                <div class="btn-group-sm" id="toolbar" role="group">
                    <a class="btn btn-primary btn-rounded btn-sm" onclick="$.operate.add()">
                        <i class="fa fa-remove"></i> 添加
                    </a>
                </div>
                <div class="col-sm-12 select-table table-striped">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<th:block th:include="include :: bootstrap-select-js"/>
<script th:inline="javascript">
    var prefix = ctx + "warframe/analyse"
    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add/{id}",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove/{id}",
            modalName: "紫卡属性值分析",
            sortOrder: "desc",
            escape: true,
            showPageGo: true,
            rememberSelected: true,
            columns: [
                {
                    field: 'state',
                    radio: true
                },
                {
                    field: 'id',
                    title: 'ID'
                },
                {
                    field: 'name',
                    title: '词条'
                },
                {
                    field: 'prefix',
                    title: '前缀'
                },
                {
                    field: 'suffix',
                    title: '后缀'
                },
                {
                    field: 'rifle',
                    title: '步枪'
                },
                {
                    field: 'shotgun',
                    title: '霰弹枪'
                },
                {
                    field: 'pistol',
                    title: '手枪'
                },
                {
                    field: 'archwing',
                    title: 'Archwing枪械'
                },
                {
                    field: 'melle',
                    title: '近战'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.uid !== 0) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(' + row.id + ')"><i class="fa fa-edit"></i>修改</a> ');
                            return actions.join('');
                        }
                    }
                }
                ]
        };
        $.table.init(options);
    });


</script>

</body>
</html>